USE [IB_GENEL]
GO

/****** Object:  Table [LOG].[CRUD_LOG]    Script Date: 01/31/2013 14:10:52 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [LOG].[CRUD_LOG](
	[CrudLogKey] [bigint] IDENTITY(1,1) NOT NULL,
	[CrudUserID] [varchar](50) NOT NULL,
	[CrudTableName] [varchar](200) NOT NULL,
	[CrudType] [char](1) NOT NULL,
	[CrudDate] [datetime] NOT NULL,
	[PKValue] [varchar](max) NOT NULL,
	[CrudValues] [varchar](max) NULL,
 CONSTRAINT [PK_CRUD_LOG] PRIMARY KEY CLUSTERED 
(
	[CrudLogKey] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique identifying information of user who made crud process. This identification may be national ID number or e-mail adres. Or anything you want.' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'CrudUserID'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The table that was performed on the crud' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'CrudTableName'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Crud type. 
"I" for Insert
"U" for Update
"D" for Delete
' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'CrudType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Crud process date' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'CrudDate'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PK (Primary Key) value of row was performed on the crud' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'PKValue'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Old values of row was performed on the crud' , @level0type=N'SCHEMA',@level0name=N'LOG', @level1type=N'TABLE',@level1name=N'CRUD_LOG', @level2type=N'COLUMN',@level2name=N'CrudValues'
GO

